package uk.co.droidinactu.sony.prst1.home.view;

import uk.co.droidinactu.sony.prst1.home.R;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public final class Page2Activity extends AbstractActivity implements OnClickListener {

	private Button btnAllNotes;
	private Button btnAudio;
	private Button btnBrowser;
	private Button btnDictionary;
	private Button btnGoogleBooks;
	private Button btnHandwriting;
	private Button btnPictures;
	private Button btnPrevPage;
	private Button btnPubliclibrary;
	private Button btnPurchasedContent;
	private Button btnSonySettings;
	private Button btnTextMemo;

	@Override
	public void onClick(final View v) {
		if (v.getTag().equals("public library")) {

		} else if (v.getTag().equals("google books")) {
			String url = "http://books.google.com/";
			Intent i = new Intent(Intent.ACTION_VIEW);
			i.setData(Uri.parse(url));
			startActivity(i);

		} else if (v.getTag().equals("browser")) {
			String url = "http://www.google.co.uk/";
			Intent i = new Intent(Intent.ACTION_VIEW);
			i.setData(Uri.parse(url));
			startActivity(i);

		} else if (v.getTag().equals("purchased content")) {

		} else if (v.getTag().equals("all notes")) {

		} else if (v.getTag().equals("dictionary")) {

		} else if (v.getTag().equals("handwriting")) {

		} else if (v.getTag().equals("text memo")) {

		} else if (v.getTag().equals("pictures")) {

		} else if (v.getTag().equals("audio")) {

		} else if (v.getTag().equals("sony settings")) {
			startActivity(new Intent(android.provider.Settings.ACTION_SETTINGS));

		} else if (v.getTag().equals("prevpage")) {
			finish();
		}
	}

	/** Called when the activity is first created. */
	@Override
	public void onCreate(final Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.page2);

		btnPrevPage = (Button) findViewById(R.id.page2_btn_prevpage);
		btnPrevPage.setOnClickListener(this);

		btnPubliclibrary = (Button) findViewById(R.id.page2_btn_public_library);
		btnPubliclibrary.setOnClickListener(this);

		btnGoogleBooks = (Button) findViewById(R.id.page2_btn_google_books);
		btnGoogleBooks.setOnClickListener(this);

		btnBrowser = (Button) findViewById(R.id.page2_btn_browser);
		btnBrowser.setOnClickListener(this);

		btnPurchasedContent = (Button) findViewById(R.id.page2_btn_purchased_content);
		btnPurchasedContent.setOnClickListener(this);

		btnAllNotes = (Button) findViewById(R.id.page2_btn_all_notes);
		btnAllNotes.setOnClickListener(this);
		// btnAllNotes.setText(String.format(getResources().getString(R.string.page2_all_notes),
		// ""+ dataModel.getNotes(this).getCount()));

		btnDictionary = (Button) findViewById(R.id.page2_btn_dictionary);
		btnDictionary.setOnClickListener(this);

		btnHandwriting = (Button) findViewById(R.id.page2_btn_handwriting);
		btnHandwriting.setOnClickListener(this);
		// btnPictures.setText(String.format(getResources().getString(R.string.page2_handwriting),
		// ""+ dataModel.gethandwriting(this).getCount()));

		btnTextMemo = (Button) findViewById(R.id.page2_btn_text_memo);
		btnTextMemo.setOnClickListener(this);

		btnPictures = (Button) findViewById(R.id.page2_btn_pictures);
		btnPictures.setOnClickListener(this);
		// btnPictures.setText(String.format(getResources().getString(R.string.page2_Pictures),
		// ""+ dataModel.getPictures(this).getCount()));

		btnAudio = (Button) findViewById(R.id.page2_btn_audio);
		btnAudio.setOnClickListener(this);

		btnSonySettings = (Button) findViewById(R.id.page2_btn_sony_settings);
		btnSonySettings.setOnClickListener(this);
	}

	@Override
	protected void onPause() {
		super.onPause();
	}

	@Override
	protected void onResume() {
		super.onResume();
	}

}
